package com.ming.controller;

import com.ming.po.Business;
import com.ming.po.ResponseBean;
import com.ming.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/BusinessController")
public class BusinessController {

	@Autowired
	private BusinessService bs;

	// 根据分类Id查询商家信息
	@GetMapping("/listBusinessByOrderTypeId")
	public ResponseBean<List<Business>> listBusinessByOrderTypeId(Integer orderTypeId){
		return bs.listBusinessByOrderTypeId(orderTypeId);
	}

	// 根据商家Id查询商家信息
	@GetMapping("/getBusinessById")
	public ResponseBean<Business> getBusinessById(Integer businessId){
		return bs.getBusinessById(businessId);
	}
}
